﻿using System.Collections.Generic;
using System.Text;
using System.Xml.Linq;

namespace SPQueryToSql.ApplicationObjects.CAML
{
    internal class IsNotNull : BaseOperator
    {
        public IsNotNull(XContainer element, IEnumerable<FieldInfo> listFields)
            : base(element, listFields)
        {
        }

        public override string CAMLElementName
        {
            get { return "IsNotNull"; }
        }

        public override string ToSql(Query query)
        {
            var sql = new StringBuilder();
            sql.AppendFormat("[{0}] IS NOT NULL", FieldInfo.InternalName);
            return sql.ToString();
        }
    }
}
